<template>
	<view>
		<!-- 公务招待申请报销审核 -->
		<view class="head_tb">
			<u-tabs :activeStyle="{
						 fontSize:'28rpx',
						 color: '#007aff'
			         }" :inactiveStyle="{
						 fontSize:'28rpx'
			         }" :scrollable='false' :lineWidth='30' itemStyle='height:80rpx;' :list="list1" @click="checkbtn"></u-tabs>
		</view>
		
		<!-- 基本信息 -->
		<view class="msp">
			<CellChild :addlist='addlist' :rows='rows' title='基本信息' isshow='true' :fileNo = 'fileNo' id='add_one'>
			</CellChild>
		</view>
		<!-- 核准信息 -->
		<!-- <CellChild :addlist='addlist1' :rows='rows' title='核准信息' isshow='true' id='add_two' /> -->

		<!-- 报销明细 -->
		<!-- <CellChild :addlist='addlist2' :rows='rows' title='报销明细' isshow='true' id='add_three' /> -->
		
		<!-- 收款人信息 -->
		<view class="formcard" id="add_four">
			<view class="bodtitle">
				<p><b>收款人信息</b></p>
			</view>
			<view v-for="(item,index) in bankEntityList" :key='index'>
				<Expandlist :cellshows='cellshow' :arrcell='item' :celllist='celllist' :title='item.payeeNm'></Expandlist>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		components:{
		},
		data() {
			return {
				list1: [{
						name: '基本信息'
					},
					{
						name: '核准信息'
					},
					{
						name: '报销明细'
					},
					{
						name: '收款人信息'
					},
				],
				addlist: [{
						tit: '单据编号',
						val: 'receptionNo'
					},
					{
						tit: '申请人',
						val: 'userDesc'
					},
					// {
					// 	tit: '员工编号',
					// 	val: 'userId'
					// },
					{
						tit: '申请科室',
						val: 'subdeptId'
					},
					// {
					// 	tit: '联系电话',
					// 	val: 'phone'
					// },
					{
						tit: '来宾单位',
						val: 'customerCompany'
					},
					{
						tit: '来宾人数',
						val: 'customerCount'
					},
					{
						tit: '主要来宾职位',
						val: 'customerPost'
					},
					{
						tit: '接待分类',
						val: 'receptionType'
					},
					{
						tit: '来访事由',
						val: 'reasons'
					},
					{
						tit: '计划用餐时间',
						val: 'planEatTime'
					},
					{
						tit: '计划用餐类型',
						val: 'planEatType'
					},
					{
						tit: '工作人员人数',
						val: 'works'
					},
					{
						tit: '餐次',
						val: 'eatNum'
					},
					{
						tit: '公司出席领导',
						val: 'factoryLeader'
					},
					{
						tit: '公司参与人员',
						val: 'factoryPerson'
					},
					{
						tit: '人数',
						val: 'factoryPersonCount'
					},
					{
						tit: '出席领导最高职位',
						val: 'factoryTopLeader'
					},
					{
						tit: '补充说明',
						val: 'moreRemakrs'
					},
				],
				//核准信息
				addlist1: [{
						tit: '年度',
						val: 'budgetYear'
					},
					{
						tit: '科室',
						val: 'costDeptNm'
					},
					{
						tit: '预算号',
						val: 'budgetNo'
					},
					{
						tit: '预算号名称',
						val: 'budgetNm'
					},
					{
						tit: '核准招待等级',
						val: 'receptionGrade'
					},
					{
						tit: '核准招待标准',
						val: 'receptionStandard'
					},
					{
						tit: '核准来宾人数',
						val: 'checkCustomerCount'
					},
					{
						tit: '核准陪餐人数',
						val: 'checkPersonCount'
					},
					{
						tit: '核准工作人员',
						val: 'checkWorks'
					},
					{
						tit: '核准申请金额',
						val: 'checkBudgetAmt',
						type:'number'
					},
				],
				addlist2:[
					{
						tit: '报销金额',
						val: 'reimAmt',
						type:'number'
					},
					{
						tit: '财务核准金额',
						val: 'checkReimAmt',
						type:'number'
					},
					{
						tit: '公司实际出席领导',
						val: 'checkFactoryLeader'
					},
					{
						tit: '实际用餐时间',
						val: 'checkEatTime'
					},
					{
						tit: '实际用餐类型',
						val: 'checkEatType'
					},
					{
						tit: '公司参与人员',
						val: 'checkFactoryPersonCount'
					},
					{
						tit: '人数',
						val: 'personCount'
					},
					{
						tit: '是否赠送礼品',
						val: 'ifGiveGift'
					},
					{
						tit: '礼品名称',
						val: 'giftDesc'
					},
					{
						tit: '核准工作人员',
						val: 'checkWorks'
					},
				],
				cellshow: true,
				celllist: [{
						tit: '收款人类型',
						val: 'payeeType'
					},
					{	
						tit: '金额',
						val: '招待费用'
					}, //无
					{
						tit: '收款开户账号',
						val: 'bankcardNo'
					},
					{
						tit: '结算方式',
						val: 'payType'
					}
				],
				rows:[],
				bankEntityList:[],
				fileNo:[]
			}
		},
		onLoad() {
			//获取流程页面的流程上下文[实用的流程信息从这里获取]
			 let billNo= window.parent.myvm.wfContext.BusinessKey;
			 this.fileNo = window.parent.myvm.wfContext.BusinessKey;
			 this.getlist(billNo)
		},
		mounted() {
			var that = this;
			window.myvm = that;
			window.$urlFormVue = that;
		},

		methods: {
			getlist(receptionNo){
				let _this = this
				const params ={
					receptionNo
				}
				_this.$lyRequest.get('/gateway/reim/mp/dbsap/reim/reception/queryBillInfo.do',
					params
				).then((result)=>{
					if(result.success){
						this.receiveList(result.data.rows)
					}else{
						console.log(result.data.msg)
					}
					
				})
			},
			receiveList(rows){
				this.rows = rows
				this.bankEntityList =rows.bankEntityList
				
				if(this.bankEntityList.ifGiveGift == '1'){
					this.bankEntityList.ifGiveGift = '是'
				}else if(this.bankEntityList.ifGiveGift == '0'){
					this.bankEntityList.ifGiveGift = '否'
				}
			},
			//审批和驳回-工作流点击"提交"时触发此函数，返回:空字符串:工作流继续提交，返回"具体错误信息":工作流不提交
			rejectWorkflow(btnDef) {
				return "";
			},
			//作废-工作流点击"作废"时触发此函数，返回:空字符串:工作流继续提交，返回"具体错误信息":工作流不提交
			//content为作废意见
			invalidWorkflow(content) {
				return "";
			},
			//转办-工作流点击"确认转办"时触发此函数，返回:空字符串:工作流继续提交，返回"具体错误信息":工作流不提交
			//opinion:转办意见
			referredWorkflow(opinion) {
				return "";
			},
			//校验-工作流点击"提交"时触校验函数，返回:true校验通过，false校验不通过；
			//也可以返回具体的错误信息：空字符串，校验通过，返回具体错误信息校验不通过，同时弹出具体的错误信息。
			validateWorkflowForm(btnDef,callback) {
				callback("");
			},
			//提交单据
			sendWorkflow(btnDef, callback) {
				callback("");
			},
			checkbtn(item) { //切换tabs
				if (item.index === 0) {
					this.commonApi.goAnchor('add_one')
				} else if (item.index === 1) {
					this.commonApi.goAnchor('add_two')
				} else if(item.index === 2) {
					this.commonApi.goAnchor('add_three')
				}else if(item.index === 3){
					this.commonApi.goAnchor('add_four')
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	view {
		font-family: pf;
	}
	.bodtitle {
		padding-left: 20rpx;
	}

	// .bod_cost {
	// 	display: flex;
	// 	flex-direction: row;
	// 	align-items: center;
	// 	justify-content: space-between;
	// }

	.bodcolor {
		span {
			color: #fa6400;
			font-size: 40rpx;
			padding-right: 20rpx;
		}

		label {
			color: #fa6400;
		}
	}

	.bottom_setup {
		width: 100%;
		height: 160rpx;
		background-color: white;
		margin-top: 20rpx;
		padding: 35rpx 0;
		box-sizing: border-box;
		box-shadow: 5px -10rpx 5px 0px rgba(225, 225, 225, .4), ;

		.bottom_white1 {
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			height: 100rpx;

			.custom-styles {
				padding: 20rpx 30rpx;
				width: 300rpx;
				height: 100rpx;
			}

			.custom-style {
				padding: 20rpx 30rpx;
				width: 300rpx;
				height: 100rpx;
				background-color: #007aff;
			}
		}
	}
</style>
